Object.defineProperty(exports, "__esModule", { value: !0 }),
  (exports.getList =
    exports.getExhibitInfo =
    exports.getCategoryList =
    exports.getAppreciationInfo =
      void 0);
var e = require("../@babel/runtime/helpers/objectSpread2"),
  t = c(require("../@babel/runtime/regenerator")),
  a = require("../@babel/runtime/helpers/toConsumableArray"),
  r = require("../@babel/runtime/helpers/slicedToArray"),
  n = require("../@babel/runtime/helpers/asyncToGenerator"),
  i = require("./base/third"),
  l = c(require("@/libs/lodash")),
  u = require("./list"),
  s = require("./base/api"),
  d = require("./user-service"),
  o = c(require("@/config/index"));
function c(e) {
  return e && e.__esModule ? e : { default: e };
}
exports.getAppreciationInfo = (function () {
  var e = n(
    t.default.mark(function e() {
      var n, d, o, c, p, f, b, g, x, m, y;
      return t.default.wrap(function (e) {
        for (;;)
          switch ((e.prev = e.next)) {
            case 0:
              return (
                (e.next = 2),
                Promise.all([
                  (0, i.postCourseData)(),
                  (0, s.getMainstayList)({ pn: 1, rn: 10, must_see: 1 }),
                  (0, s.getMainstayList)({ pn: 2, rn: 10, must_see: 1 }),
                ])
              );
            case 2:
              return (
                (n = e.sent),
                (d = r(n, 3)),
                (o = d[0]),
                (c = d[1]),
                (p = d[2]),
                (f = c).data.list &&
                  l.default.get(p, "data.list", []).length > 0 &&
                  (f.data.list = [].concat(
                    a(f.data.list),
                    a(l.default.get(p, "data.list", [])),
                  )),
                (b = l.default.get(f, "data.list", []).map(function (e) {
                  return e.exhibit_id;
                })),
                (e.next = 12),
                (0, s.postExhibitInfo)({ exhibit_id: b })
              );
            case 12:
              return (
                (g = e.sent),
                (x = l.default.get(f, "data.list", []).map(function (e, t) {
                  return {
                    album: e.album,
                    mainstay_id: e.mainstay_id,
                    name: l.default.get(g.data[t], "name", ""),
                    url_3d: l.default.get(g.data[t], "url_3d", ""),
                    audio: l.default.get(g.data[t], "audio", [])
                      ? l.default.get(g.data[t], "audio", [])[0]
                      : {},
                  };
                })),
                (m = l.default.get(o, "data.esbpayload.data", [])),
                (y = (0, u.getReList)()),
                e.abrupt("return", {
                  courseList: m,
                  silkList: y,
                  mustSeeList: x,
                })
              );
            case 17:
            case "end":
              return e.stop();
          }
      }, e);
    }),
  );
  return function () {
    return e.apply(this, arguments);
  };
})();
var p = (exports.getCategoryList = function () {
    return new Promise(function (e) {
      e([
        { index: 0, label: "全部", desc: "" },
        {
          index: 1,
          label: "铜器",
          desc: "三星堆博物馆的铜器展示了古蜀文明的高超铸造技艺。这些铜器包括祭祀用品、武器、生活用具等，造型独特，线条流畅。部分铜器表面有精美的纹饰，反映了当时的社会风俗和审美观念。",
        },
        {
          index: 2,
          label: "金银器",
          desc: "金银器在三星堆遗址中较为罕见，但仍展示了古蜀文明的贵族生活。这些金银器主要包括饰品、器皿等，工艺精湛，造型优美，展现了当时的高度繁荣与富裕。",
        },
        {
          index: 3,
          label: "玉石器、宝石",
          desc: "三星堆的玉石器和宝石类文物包括玉器、玛瑙、水晶等，多为礼器、饰品和器具。这些文物雕琢精细，线条优美，展示了古蜀文明在玉石加工方面的高超技艺。",
        },
        {
          index: 4,
          label: "陶器",
          desc: "三星堆陶器种类繁多，包括陶罐、陶盆、陶瓶等生活用具，以及陶俑、陶器等祭祀用品。这些陶器造型简约，线条流畅，彩绘图案丰富多样，反映了当时的生活场景和审美风格。",
        },
        {
          index: 5,
          label: "雕塑、造像",
          desc: "三星堆的雕塑和造像主要包括青铜立人、青铜神树等。这些作品线条流畅，形态生动，展现了古蜀文明在雕塑艺术方面的独特风格和高度成就。",
        },
        {
          index: 6,
          label: "石器、石刻、砖瓦",
          desc: "三星堆的石器、石刻和砖瓦类文物主要包括石磨、石锛、石刻碑文等。这些文物展示了古蜀文明在石器制作和石刻技艺方面的成就，反映了当时建筑技术和风格，为我们了解古蜀文明的生产、生活和建筑风貌提供了珍贵的实物资料。",
        },
        { index: 7, label: "牙骨角器", desc: "" },
        { index: 8, label: "武器", desc: "" },
        { index: 9, label: "钱币", desc: "" },
        { index: 10, label: "其他", desc: "" },
      ]);
    });
  }),
  f =
    ((exports.getList = (function () {
      var a = n(
        t.default.mark(function a(r) {
          var n, i, u, d, c, f, b, g;
          return t.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (t.next = 2), p();
                case 2:
                  if (
                    ((n = t.sent),
                    (i = l.default.get(r, "category", [])),
                    "全部" !== l.default.get(r, "category", [])[0])
                  ) {
                    t.next = 12;
                    break;
                  }
                  return (
                    (n = n.slice(1)),
                    (u = n.map(function (e) {
                      return (0, s.postExhibitSearch)({
                        pn: 1,
                        rn: 3,
                        category: [e.label],
                      });
                    })),
                    (t.next = 9),
                    Promise.all(u)
                  );
                case 9:
                  return (
                    (d = t.sent),
                    (c = n.map(function (t, a) {
                      return e(
                        e({}, t),
                        {},
                        {
                          list: l.default
                            .get(d[a], "data.list", [])
                            .map(function (t) {
                              return e(
                                e({}, t),
                                {},
                                {
                                  pic:
                                    null != t && t.album[0]
                                      ? t.album[0]
                                      : o.default.defaultImg,
                                  dynasty: (t.dynasty || "").replaceAll(
                                    "中国历史学年代,",
                                    "",
                                  ),
                                },
                              );
                            }),
                        },
                      );
                    })),
                    t.abrupt("return", c)
                  );
                case 12:
                  return (
                    (t.next = 14),
                    (0, s.postExhibitSearch)(e(e({}, r), {}, { category: i }))
                  );
                case 14:
                  return (
                    (f = t.sent),
                    (b = l.default.find(n, function (e) {
                      return e.label === r.category;
                    })),
                    (g = l.default.get(f, "data.list", []).map(function (t) {
                      return e(
                        e({}, t),
                        {},
                        {
                          pic:
                            null != t && t.album[0]
                              ? t.album[0]
                              : o.default.defaultImg,
                          dynasty: (t.dynasty || "").replaceAll(
                            "中国历史学年代,",
                            "",
                          ),
                        },
                      );
                    })),
                    t.abrupt(
                      "return",
                      e(
                        e(e({}, b), l.default.get(f, "data", {})),
                        {},
                        {
                          list: g,
                          isLast:
                            l.default.get(r, "pn", 0) *
                              l.default.get(r, "rn", 0) >=
                            l.default.get(f, "data.total", 0),
                        },
                      ),
                    )
                  );
                case 18:
                case "end":
                  return t.stop();
              }
          }, a);
        }),
      );
      return function (e) {
        return a.apply(this, arguments);
      };
    })()),
    (exports.getExhibitInfo = (function () {
      var a = n(
        t.default.mark(function a(r) {
          var n, i, u, c, p, b, g, x, m, y;
          return t.default.wrap(function (t) {
            for (;;)
              switch ((t.prev = t.next)) {
                case 0:
                  return (t.next = 2), (0, d.getUserId)();
                case 2:
                  return (
                    (p = t.sent),
                    (t.t0 = Promise),
                    (t.t1 = (0, s.postExhibitInfo)({ exhibit_id: [r] })),
                    (t.next = 7),
                    (0, s.myCollectionList)({
                      longitude: 1,
                      latitude: 1,
                      openId: p,
                      type: 3,
                      relative_ids: r,
                    })
                  );
                case 7:
                  return (
                    (t.t2 = t.sent),
                    (t.t3 = [t.t1, t.t2]),
                    (t.next = 11),
                    t.t0.all.call(t.t0, t.t3)
                  );
                case 11:
                  if (
                    ((b = t.sent),
                    (g =
                      (null === (n = b[0]) || void 0 === n
                        ? void 0
                        : n.data[0]) || {}),
                    (x = l.default.get(b[1], "data.total", 0) > 0),
                    (m = {}),
                    null == g || !g.poi_id)
                  ) {
                    t.next = 20;
                    break;
                  }
                  return (
                    (t.next = 18),
                    (0, s.postPointsDetail)({
                      poi_id: [null == g ? void 0 : g.poi_id],
                    })
                  );
                case 18:
                  (y = t.sent), (m = (null == y ? void 0 : y.data[0]) || {});
                case 20:
                  return t.abrupt(
                    "return",
                    e(
                      e({}, g),
                      {},
                      {
                        album:
                          null != g &&
                          null !== (i = g.album) &&
                          void 0 !== i &&
                          i[0]
                            ? g.album
                            : [o.default.defaultImg],
                        isCollect: x,
                        audio:
                          (null == g || null === (u = g.audio) || void 0 === u
                            ? void 0
                            : u[0]) || {},
                        video:
                          (null == g || null === (c = g.video) || void 0 === c
                            ? void 0
                            : c[0]) || {},
                        items: f(g),
                        poiInfo: m,
                      },
                    ),
                  );
                case 21:
                case "end":
                  return t.stop();
              }
          }, a);
        }),
      );
      return function (e) {
        return a.apply(this, arguments);
      };
    })()),
    function (e) {
      var t = [];
      return (
        e.dynasty &&
          t.push({
            title: "所属年代：",
            val: e.dynasty.replaceAll("中国历史学年代,", ""),
          }),
        e.level && t.push({ title: "藏品级别：", val: e.level }),
        e.category && t.push({ title: "藏品类别：", val: e.category }),
        e.quality && t.push({ title: "质量：", val: e.quality }),
        e.size && t.push({ title: "外形尺寸：", val: e.size }),
        e.unearthed_desc &&
          t.push({ title: "出土情况：", val: e.unearthed_desc }),
        t
      );
    });
